package com.nbufe.command.demo3;

/**
 * @Author Zan
 * @Create 2024/6/12 14:46
 * @ClassName: DividerCommand
 * @Description : TODO 请用一句话描述该类的功能
 */
public class DividerCommand extends AbstractCommand {

    private Divider divider = new Divider();

    private double value;

    @Override
    public double compute(int value) {
        this.value = value;
        return divider.divide(value);
    }

    @Override
    public double revoke() {
        return divider.divide(1.0 / value);
    }

    @Override
    public double resume() {
        return divider.divide(value);
    }
}
